//按行读取
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#define BUFSIZE 1024
#define ROWSZ 20

int is_wqpf_number(int n)
{
    int x;
    x = (int)sqrt(n);
    if(x * x == n)
    {
        return 1;
    }
    else 
    {
        return 0;
    }
}

int get_number(char *str)
{
    int cnt = 0, num = 0;
    for(; *str != '\0'; cnt++)
    {
        
    }
}

int main(int argc, char *argv[])
{
    FILE *fp_r,*fp_w;
    int i, j = 0, k = 0, cnt;

    char arr_code[BUFSIZE];
    char arr_data[ROWSZ] = {0};
    char ch_tmp[] = {'\0'};
    
    fp_r = fopen("haoma.txt", "r");

    if(fp_r == NULL)
    {
        perror("haoma.txt can not open!");
        exit(1);
    }
    
    // while(!feof(fp_r))
    // {
    //    fscanf(fp_r, "%s", &arr_code);
    //    printf("%s", arr_code);
    //    printf("\n");
    // }

     while(!feof(fp_r))
    {
       fscanf(fp_r, "%s", &arr_code);
       //read  a line and store to a variable like 'ch_tmp'
       strcpy(ch_tmp, arr_code);
       printf("%s\n",ch_tmp);

       //printf("%s", arr_code);
       //printf("\n---\n");
    //    printf("%s", arr_code);
    //    printf("\n");
    }

    
    if(fp_w == NULL)
    {
        perror("haoma.txt can not open!");
        exit(1);
    }
    

    printf("\n");
    fclose(fp_r);
    return 0;
}